export const playMixin = {
  data () {
    return {
      playIndex: 0.5
    }
  },
  created () {
    this.$bus.$on('Playing', (index, path) => {
      if (this.$route.path === path) {
        this.playIndex = index;
      }
    })
  },
  methods: {
    // 双击播放音乐
    musicItemClick (index) {
      if (this.$parent.$parent.$el.className.indexOf('play-music-list') !== -1) {
        this.$bus.$emit('PlayMusicList', index)
        return
      }
      this.$emit('musicItemClick', index);
    }
  },
}
